from .views import *
from django.urls import path
from rest_framework.routers import DefaultRouter # 默认路由器

# urlpatterns = [
#     path('students/', StudentsViewset.as_view({'get': 'list', 'post': 'create'})),
#     path('students/<pk>/', StudentsViewset.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destory'})),
# ]



urlpatterns = []

# 创建路由器
router = DefaultRouter()
# 注册路由器
router.register('students', StudentsViewSet)
# 路由添加至urlpatterns列表中
urlpatterns += router.urls